home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / SMILEYC.PAK / SMILECTL.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  2KB  |  82 lines

  1. // SmileCtl.h : Declaration of the CSmileCtrl OLE control class.
  2.  
  3. /////////////////////////////////////////////////////////////////////////////
  4. // CSmileCtrl : See SmileCtl.cpp for implementation.
  5.  
  6. class CSmileCtrl : public COleControl
  7. {
  8.     DECLARE_DYNCREATE(CSmileCtrl)
  9.  
  10. // Constructor
  11. public:
  12.     CSmileCtrl();
  13.  
  14.  
  15. // Attributes
  16. protected:
  17.     BOOL    m_bWink;        // Determines if Eye should 'blink'
  18.  
  19. // Overrides
  20. public:
  21.     // Drawing function
  22.     virtual void OnDraw(
  23.                 CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
  24.  
  25.     // Persistence
  26.     virtual void DoPropExchange(CPropExchange* pPX);
  27.  
  28.     // Reset control state
  29.     virtual void OnResetState();
  30.  
  31. // Implementation
  32. protected:
  33.     ~CSmileCtrl();
  34.  
  35.     // Hit Testing Helper
  36.     BOOL InEllipse(const CPoint& pt, int x1, int y1, int x2, int y2);
  37.  
  38.  
  39.     DECLARE_OLECREATE_EX(CSmileCtrl)    // Class factory and guid
  40.     DECLARE_OLETYPELIB(CSmileCtrl)      // GetTypeInfo
  41.     DECLARE_PROPPAGEIDS(CSmileCtrl)     // Property page IDs
  42.     DECLARE_OLECTLTYPE(CSmileCtrl)        // Type name and misc status
  43.  
  44. // Message maps
  45.     //{{AFX_MSG(CSmileCtrl)
  46.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  47.     //}}AFX_MSG
  48.     DECLARE_MESSAGE_MAP()
  49.  
  50. // Dispatch maps
  51.     //{{AFX_DISPATCH(CSmileCtrl)
  52.     BOOL m_bSad;
  53.     afx_msg void OnSadChanged();
  54.     afx_msg void Beep();
  55.     afx_msg void Wink(BOOL bWink);
  56.     //}}AFX_DISPATCH
  57.     DECLARE_DISPATCH_MAP()
  58.  
  59.     afx_msg void AboutBox();
  60.  
  61. // Event maps
  62.     //{{AFX_EVENT(CSmileCtrl)
  63.     void FireOutside()
  64.         {FireEvent(eventidOutside,EVENT_PARAM(VTS_NONE));}
  65.     void FireInside(OLE_XPOS_PIXELS x, OLE_YPOS_PIXELS y)
  66.         {FireEvent(eventidInside,EVENT_PARAM(VTS_XPOS_PIXELS  VTS_YPOS_PIXELS), x, y);}
  67.     //}}AFX_EVENT
  68.     DECLARE_EVENT_MAP()
  69.  
  70. // Dispatch and event IDs
  71. public:
  72.     enum {
  73.     //{{AFX_DISP_ID(CSmileCtrl)
  74.     dispidSad = 1L,
  75.     dispidBeep = 2L,
  76.     dispidWink = 3L,
  77.     eventidOutside = 1L,
  78.     eventidInside = 2L,
  79.     //}}AFX_DISP_ID
  80.     };
  81. };
  82.